Integrand size = 12, antiderivative size = 72 \[ \int (a+b \tan (c+d x))^3 \, dx=a \left (a^2-3 b^2\right ) x-\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d} \]
a*(a^2-3*b^2)*x-b*(3*a^2-b^2)*ln(cos(d*x+c))/d+2*a*b^2*tan(d*x+c)/d+1/2*b* (a+b*tan(d*x+c))^2/d
Result contains complex when optimal does not.
Time = 0.25 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.10 \[ \int (a+b \tan (c+d x))^3 \, dx=\frac {(i a-b)^3 \log (i-\tan (c+d x))-(i a+b)^3 \log (i+\tan (c+d x))+6 a b^2 \tan (c+d x)+b^3 \tan ^2(c+d x)}{2 d} \]
((I*a - b)^3*Log[I - Tan[c + d*x]] - (I*a + b)^3*Log[I + Tan[c + d*x]] + 6 *a*b^2*Tan[c + d*x] + b^3*Tan[c + d*x]^2)/(2*d)
Time = 0.38 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 3963, 3042, 4008, 3042, 3956}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+b \tan (c+d x))^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+b \tan (c+d x))^3dx\) |
\(\Big \downarrow \) 3963 |
\(\displaystyle \int (a+b \tan (c+d x)) \left (a^2+2 b \tan (c+d x) a-b^2\right )dx+\frac {b (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+b \tan (c+d x)) \left (a^2+2 b \tan (c+d x) a-b^2\right )dx+\frac {b (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 4008 |
\(\displaystyle b \left (3 a^2-b^2\right ) \int \tan (c+d x)dx+a x \left (a^2-3 b^2\right )+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b \left (3 a^2-b^2\right ) \int \tan (c+d x)dx+a x \left (a^2-3 b^2\right )+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle -\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+a x \left (a^2-3 b^2\right )+\frac {2 a b^2 \tan (c+d x)}{d}+\frac {b (a+b \tan (c+d x))^2}{2 d}\) |
a*(a^2 - 3*b^2)*x - (b*(3*a^2 - b^2)*Log[Cos[c + d*x]])/d + (2*a*b^2*Tan[c + d*x])/d + (b*(a + b*Tan[c + d*x])^2)/(2*d)
3.5.38.3.1 Defintions of rubi rules used
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] + Int[(a^2 - b^2 + 2*a*b*Tan[c + d *x])*(a + b*Tan[c + d*x])^(n - 2), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0] && GtQ[n, 1]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), x] + Simp[(b*c + a*d) Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Time = 0.24 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.01
method | result | size |
norman | \(\left (a^{3}-3 a \,b^{2}\right ) x +\frac {b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {3 a \,b^{2} \tan \left (d x +c \right )}{d}+\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(73\) |
derivativedivides | \(\frac {\frac {b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 a \,b^{2} \tan \left (d x +c \right )+\frac {\left (3 a^{2} b -b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a^{3}-3 a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(74\) |
default | \(\frac {\frac {b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 a \,b^{2} \tan \left (d x +c \right )+\frac {\left (3 a^{2} b -b^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (a^{3}-3 a \,b^{2}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(74\) |
parallelrisch | \(\frac {2 a^{3} d x -6 a \,b^{2} d x +b^{3} \left (\tan ^{2}\left (d x +c \right )\right )+3 \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{2} b -\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) b^{3}+6 a \,b^{2} \tan \left (d x +c \right )}{2 d}\) | \(79\) |
parts | \(a^{3} x +\frac {b^{3} \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}+\frac {3 a \,b^{2} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {3 a^{2} b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(83\) |
risch | \(3 i a^{2} b x -i b^{3} x +a^{3} x -3 a \,b^{2} x +\frac {6 i b \,a^{2} c}{d}-\frac {2 i b^{3} c}{d}+\frac {2 b^{2} \left (3 i a \,{\mathrm e}^{2 i \left (d x +c \right )}+b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 i a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(140\) |
(a^3-3*a*b^2)*x+1/2*b^3*tan(d*x+c)^2/d+3*a*b^2*tan(d*x+c)/d+1/2*b*(3*a^2-b ^2)/d*ln(1+tan(d*x+c)^2)
Time = 0.25 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.99 \[ \int (a+b \tan (c+d x))^3 \, dx=\frac {b^{3} \tan \left (d x + c\right )^{2} + 6 \, a b^{2} \tan \left (d x + c\right ) + 2 \, {\left (a^{3} - 3 \, a b^{2}\right )} d x - {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \]
1/2*(b^3*tan(d*x + c)^2 + 6*a*b^2*tan(d*x + c) + 2*(a^3 - 3*a*b^2)*d*x - ( 3*a^2*b - b^3)*log(1/(tan(d*x + c)^2 + 1)))/d
Time = 0.10 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.31 \[ \int (a+b \tan (c+d x))^3 \, dx=\begin {cases} a^{3} x + \frac {3 a^{2} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 3 a b^{2} x + \frac {3 a b^{2} \tan {\left (c + d x \right )}}{d} - \frac {b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {b^{3} \tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tan {\left (c \right )}\right )^{3} & \text {otherwise} \end {cases} \]
Piecewise((a**3*x + 3*a**2*b*log(tan(c + d*x)**2 + 1)/(2*d) - 3*a*b**2*x + 3*a*b**2*tan(c + d*x)/d - b**3*log(tan(c + d*x)**2 + 1)/(2*d) + b**3*tan( c + d*x)**2/(2*d), Ne(d, 0)), (x*(a + b*tan(c))**3, True))
Time = 0.30 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.08 \[ \int (a+b \tan (c+d x))^3 \, dx=a^{3} x - \frac {3 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a b^{2}}{d} - \frac {b^{3} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{2 \, d} + \frac {3 \, a^{2} b \log \left (\sec \left (d x + c\right )\right )}{d} \]
a^3*x - 3*(d*x + c - tan(d*x + c))*a*b^2/d - 1/2*b^3*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d + 3*a^2*b*log(sec(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 543 vs. \(2 (70) = 140\).
Time = 0.58 (sec) , antiderivative size = 543, normalized size of antiderivative = 7.54 \[ \int (a+b \tan (c+d x))^3 \, dx=\frac {2 \, a^{3} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 6 \, a b^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 3 \, a^{2} b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + b^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 4 \, a^{3} d x \tan \left (d x\right ) \tan \left (c\right ) + 12 \, a b^{2} d x \tan \left (d x\right ) \tan \left (c\right ) + b^{3} \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + 6 \, a^{2} b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) - 2 \, b^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) - 6 \, a b^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) - 6 \, a b^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} + 2 \, a^{3} d x - 6 \, a b^{2} d x + b^{3} \tan \left (d x\right )^{2} + b^{3} \tan \left (c\right )^{2} - 3 \, a^{2} b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) + b^{3} \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) + 6 \, a b^{2} \tan \left (d x\right ) + 6 \, a b^{2} \tan \left (c\right ) + b^{3}}{2 \, {\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, d \tan \left (d x\right ) \tan \left (c\right ) + d\right )}} \]
1/2*(2*a^3*d*x*tan(d*x)^2*tan(c)^2 - 6*a*b^2*d*x*tan(d*x)^2*tan(c)^2 - 3*a ^2*b*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c )^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)^2*tan(c)^2 + b^3*log(4*(tan(d*x )^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)^2*tan(c)^2 - 4*a^3*d*x*tan(d*x)*tan(c) + 12*a*b^2* d*x*tan(d*x)*tan(c) + b^3*tan(d*x)^2*tan(c)^2 + 6*a^2*b*log(4*(tan(d*x)^2* tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan( c)^2 + 1))*tan(d*x)*tan(c) - 2*b^3*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x) *tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)*t an(c) - 6*a*b^2*tan(d*x)^2*tan(c) - 6*a*b^2*tan(d*x)*tan(c)^2 + 2*a^3*d*x - 6*a*b^2*d*x + b^3*tan(d*x)^2 + b^3*tan(c)^2 - 3*a^2*b*log(4*(tan(d*x)^2* tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan( c)^2 + 1)) + b^3*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan( d*x)^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1)) + 6*a*b^2*tan(d*x) + 6*a*b^2 *tan(c) + b^3)/(d*tan(d*x)^2*tan(c)^2 - 2*d*tan(d*x)*tan(c) + d)
Time = 5.37 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.47 \[ \int (a+b \tan (c+d x))^3 \, dx=\frac {b^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,d}+\frac {\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right )}{d}+\frac {3\,a\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (c+d\,x\right )\,\left (a^2-3\,b^2\right )}{3\,a\,b^2-a^3}\right )\,\left (a^2-3\,b^2\right )}{d} \]